package com.ssm.helong.shop.Dao;

import com.ssm.helong.shop.entity.GoodsCategory;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsCategoryMapper {

    int insertSelective(GoodsCategory goodsCategory);

    GoodsCategory selectByPrimaryKey(Integer categoryId);

    GoodsCategory selectByParentId(Integer parentId);

    List<GoodsCategory> selectFindAllGoods();

    int updateByPrimaryKey(GoodsCategory goodsCategory);

    GoodsCategory selectByLevelAndName(@Param("categoryLevel") Integer categoryLevel, @Param("categoryName") String categoryName);
    /**
     * 把上架状态修改为1
     * @param categoryId
     * @return
     */
    int deleteByPrimaryKey(Integer categoryId);

    List<GoodsCategory> selectByLevelAndParentIdsAndNumber(@Param("parentIds") List<Integer> parentIds, @Param("categoryLevel") int categoryLevel, @Param("number") int number);
}
